package com.javaAPI.demo10;

import java.util.Arrays;

public class Test7 {
    public static void main(String[] args) {

        String str = "100,34,564,7457,252,56";
        //1.分割
        String[] split = str.split(",");
        int[] arr = new int[split.length];
        //2.转换为int
        for (int i = 0; i < split.length; i++) {
            //字符串转换为int类型赋值
            arr[i] = Integer.parseInt(split[i]);
        }
        //3.排序
        Arrays.sort(arr);

        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]);
            if (i != arr.length - 1 ) {
                System.out.print(",");
            }

        }
    }
}
